package com.clwl.supervise.superviseapp.mapper.supervise;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.clwl.supervise.superviseapp.entity.supervise.JgSamplingCompany;
import com.clwl.supervise.superviseapp.entity.supervise.JgSamplingFile;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface JgSamplingFileMapper extends BaseMapper<JgSamplingFile> {
    /**
     * 按企业推送ID统计文件数量
     *
     * @param samplingPushId
     * @return
     */
    int queryCompanyViewFilesCountByPushId(@Param("samplingPushId") Long samplingPushId);

    /**
     * 删除文件信息Id
     *
     * @param fileId 文件id
     * @return
     */
    int deleteSamplingFieByFileId(@Param("fileId") Long fileId);

    /**
     * 查询企业提送文件列表
     *
     * @param samplingPushId 企业推送id
     * @return list
     */
    List<JgSamplingFile> querySamplingFileListByPushId(@Param("samplingPushId") Long samplingPushId);

    Page<Map<String, Object>> findCompanyViewFilesPage(Page<JgSamplingCompany> page, @Param("samplingPushId") Long samplingPushId);
}